# RabbitMQ

FROM            10.0.16.125:5080/general/ubuntu:16.04
MAINTAINER      Lijc lijc@siccs.cn
# install deb
RUN             apt-get update && apt-get -y install rabbitmq-server
# create pid directory
RUN             mkdir /var/run/rabbitmq && chown rabbitmq.rabbitmq /var/run/rabbitmq
# modify config file
RUN             echo 'RABBITMQ_PID_FILE=/var/run/rabbitmq/rabbitmq.pid' >> /etc/rabbitmq/rabbitmq-env.conf
# create persistent volume directory
RUN             mkdir /opt/pv
RUN             cd /opt/pv && mkdir -p rabbitmq_data rabbitmq_log
RUN             rm -rf /var/lib/rabbitmq/mnesia /var/log/rabbitmq
RUN             ln -s /opt/pv/rabbitmq_data /var/lib/rabbitmq/mnesia
RUN             ln -s /opt/pv/rabbitmq_log /var/log/rabbitmq
# import docker entry script
ADD             docker-entrypoint /opt/
RUN             chmod 0755 /opt/docker-entrypoint
EXPOSE          5672
CMD             /opt/docker-entrypoint

